home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 638 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.3 KB

  1. Path: chronicle.mti.sgi.com!austern
  2. From: axl@zedat.fu-berlin.de (Axel Thimm)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Streams and eof()
  5. Date: 05 Mar 1996 09:40:45 PST
  6. Organization: FU Berlin, Fachbereich Physik, Institut fuer Theoretische Physik
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <4hgap6$6o7@fu-berlin.de>
  9. References: <199603010214.VAA16273@pleiades.cs.rpi.edu> <KANZE.96Mar4112305@gabi.gabi-soft.fr>
  10. Reply-To: axl@zedat.fu-berlin.de
  11. NNTP-Posting-Host: isolde.mti.sgi.com
  12. X-Original-Date: Tue, 05 Mar 1996 03:00:50 GMT
  13. X-Access: 16 17 19
  14. X-Newsreader: Forte Free Agent 1.0.82
  15. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  16.     iQBVAwUBMTx8rEy4NqrwXLNJAQG8XQIAwetfl9yOcz/cnZgxzeIt+dKgTrcJXlIg
  17.     UFWdrjdr29SrE3IQmOrZhsGn0lvD+chZeyV+mzynL3wtOOlzep4uMQ==
  18.     =Q4Y2
  19. Originator: austern@isolde.mti.sgi.com
  20.  
  21. kanze@gabi-soft.fr (J. Kanze) wrote:
  22.  
  23. >In article <199603010214.VAA16273@pleiades.cs.rpi.edu>
  24. >axl@zedat.fu-berlin.de (Axel Thimm) writes:
  25.  
  26. >|> I have had a look in the April draft, but I think that there is a small
  27. >|> ambiguity about eof() methods in streams.
  28. >|> Is the eof-flag raised, when the end of the stream is reached, or when
  29. >|> an attempt to move past this end is made?
  30. [...]
  31. >|> Declaring the end of a stream as the first charachter _after_ the last
  32. >|> character of the stream would rescue the expression, but wouldn't fit
  33. >|> into a concept of an end. (Usually one thinks of an end as belonging to
  34. >|> the whole)
  35. >|> As I am rather convinced, that the eof is raised at an attempt to meove
  36. >|> past the end, I'd like to ask how to check this in a binary file without
  37. >|> having to perform a movement.
  38.  
  39. >You might want to try the function `peek'.  I tend to use this function
  40. >a lot.  Basically, this forces a look-ahead, which will set the eof if
  41. >there is nothing more there.
  42.  
  43. But I think that you can use this only with text streams, not with
  44. binary streams (You would not be able to tell a eof-char from an
  45. ordinary binary char).
  46. ===
  47. Axel Thimm <axl@zedat.fu-berlin.de>
  48. Freie Universitaet Berlin
  49. ===
  50. ---
  51. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  52.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  53.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  54.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  55.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  56. ]
  57.